-
Notifications
You must be signed in to change notification settings - Fork 2.8k
TexBox: Data-type validation for max chars (fixes #18817) #20843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds input validation constraints to the TextBox property editor's "Maximum allowed characters" configuration field. The change prevents developers from entering invalid values (outside the 1-512 range) through the UI, addressing issue #18817.
Key Changes
- Added
configarray to themaxCharssetting with min (1), max (512), and placeholder (512) constraints - Removed the description text that previously indicated "If empty, 512 character limit"
| properties: [ | ||
| { | ||
| alias: 'maxChars', | ||
| label: 'Maximum allowed characters', |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The description has been removed, but it would be helpful to update it rather than remove it completely. Consider adding a description similar to TextArea's approach. For example: "If empty, defaults to 512 characters" or "Maximum 512 characters allowed" to clarify the constraint being applied.
| label: 'Maximum allowed characters', | |
| label: 'Maximum allowed characters', | |
| description: 'If empty, defaults to 512 characters.', |
| description: 'If empty, 512 character limit', | ||
| propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer', | ||
| config: [ | ||
| { alias: 'min', value: 1 }, |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The minimum value is set to 1, which prevents users from setting maxChars to 0. However, the related TextArea property editor allows a minimum of 0 for its maxChars configuration (meaning unlimited). Consider whether TextBox should also allow 0 for consistency, or if there's a specific reason to enforce a minimum of 1 character.
| { alias: 'min', value: 1 }, | |
| { alias: 'min', value: 0 }, |
Fixes #18817
With the aspect that this guides the deveoper to do it right via the UI.